<template>
  <el-button @click="submit">显示图片</el-button>

</template>


<script setup>
import {toRefs} from "vue";
import {defineProps} from 'vue';
import imageLabel from "@/utils/ImageLabel.js";
import submitResult from "@/api/task/submit/submitDetailedResult.js";

const props = defineProps({
  data: {
    type: String,
    default: () => ''
  },
  id: {
    type: Number,
    default: () => 0
  },
  target: {
    type: Array,
    default: () => []
  }
})
const {data, id, target} = toRefs(props);

const submit = (t) => {
  t.preventDefault();
  window.c = imageLabel({
    img: data.value,
    only: !1,
    isbutton: false,
    close: function (t) {
      console.log(t);
      return true;
    },
    clickArea: function () {
    },
    edit: function () {
    },
    startArea: function () {
    },
    confirm: function (t) {

      submitResult(t, id.value, target.value);

      return true;
    }
  })

}
</script>

<style scoped>

</style>